//
//  ManyListenHeaderView.m
//  NewMusic
//
//  Created by dllo on 15/11/15.
//  Copyright © 2015年 Going. All rights reserved.
//

#import "ManyListenHeaderView.h"
#import <SDWebImageManager.h>
#import <UIImageView+WebCache.h>
@implementation ManyListenHeaderView
- (void)dealloc {
    [_picImage release];
    [_listView release];
    [_picString release];
    [super dealloc];
}
- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        //创建视图
        [self createSubView];
    }
    return self;
}
#pragma mark 创建视图
-(void)createSubView {
    //图片
    self.picImage = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
    [self addSubview:_picImage];
    [_picImage release];
    self.listView = [[ManyListenListView alloc]initWithFrame:CGRectMake(0, self.frame.size.height - 50, self.frame.size.width, 50)];
    [self addSubview:_listView];
    [_listView release];
}
#pragma mark 重写picString的setter方法
-(void)setPicString:(NSString *)picString {
    if (_picString != picString) {
        [_picString release];
        _picString = [picString copy];
    }
    if (![picString isEqualToString:@""]) {
        [_picImage sd_setImageWithURL:[NSURL URLWithString:picString]];
    }
    
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
